import piniaPersistConfig from "../helper/persist";
import { getDetailListApi } from "./../../api/modules/login";
import { defineStore } from "pinia";

export const useDetailStore = defineStore({
  id: "Detail",
  state: (): any => ({
    detailData: []
  }),

  getters: {
    // 获取detailData
    getDetailData: state => state.detailData
  },
  actions: {
    async setDetailData() {
      const { data } = await getDetailListApi();

      this.detailData = data;
    //   console.log("data", this.detailData);
    }
  },
  persist: piniaPersistConfig("Detail")
});
